import paddle, os, datasets
import tokenizer

class input_training_data:
    """
    用以输入训练数据的迭代器
    """
    def __init__(self, data):
        self.data = data
        self.idx = 0
        self.max_len = len(data)

    def __iter__(self):
        return self

    def __next__(self):
        if self.idx < self.max_len:
            res = self.data[self.idx]
            self.idx += 1
            return res
        else:
            raise StopIteration



